package com.cicigodd.brick.plug.system.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cicigodd.brick.plug.common.entity.SimpleUserInfo;
import com.cicigodd.brick.plug.common.response.PageResult;
import com.cicigodd.brick.plug.system.user.api.SysUserServiceApi;
import com.cicigodd.brick.plug.system.user.entity.SysUser;
import com.cicigodd.brick.plug.system.user.request.*;
import com.cicigodd.brick.plug.system.user.response.SysUserDetailResponse;
import com.cicigodd.brick.plug.system.user.response.SysUserListResponse;

import java.util.List;


/**
 * 系统用户管理
 *
 * @author cicigodd
 * @date 2022/09/22 14:42:03
 */
public interface SysUserService extends IService<SysUser>, SysUserServiceApi {

    /**
     * 添加
     */
    void add(SysUserAddRequest sysUserAddRequest);

    /**
     * 删除
     */
    void delete(SysUserDeleteRequest sysUserDeleteRequest);

    /**
     * 编辑
     */
    void edit(SysUserEditRequest sysUserEditRequest);

    /**
     * 详情
     */
    SysUserDetailResponse detail(SysUserDetailRequest sysUserDetailRequest);

    /**
     * 分页列表
     */
    PageResult<SysUserListResponse> list(SysUserListRequest sysUserListRequest);

    /**
     * 根据账号获取用户
     *
     * @param account 账号
     * @return 用户信息
     */
    SysUser getUserByAccount(String account);

    /**
     * 重置密码
     *
     * @param sysUserAddRequest
     */
    void resetPwd(SysUserResetRequest sysUserAddRequest);

    /**
     * 更新密码
     *
     * @param sysUserUpdatePwdRequest
     */
    void updatePassword(SysUserUpdatePwdRequest sysUserUpdatePwdRequest);

    /**
     * 获取个人信息
     *
     * @return
     */
    SimpleUserInfo getUserInfo(Integer userId);

    List<Integer> getRoleIdsByUserId(Integer userId);

    /**
     * 更新用户信息
     * @param sysUserUpdateUserInfoRequest
     */
    void updateUserInfo(SysUserUpdateUserInfoRequest sysUserUpdateUserInfoRequest);

}